import {Outlet, useNavigate, NavLink, redirect} from "react-router-dom";
import React, {useEffect, useState} from 'react';
import {Card, Col, ConfigProvider, Flex, Layout, Menu, Row, theme} from 'antd';
import AllRoute from "./routes/allroutes"

const {Content, Sider} = Layout;
const items = AllRoute.map((itm, idx) => {
    return {
        key: idx,
        path: itm.path,
        label: (
            <NavLink to={itm.path}>
                {itm.name}
            </NavLink>
        )
    }
});
export default function APP() {
    const navigate = useNavigate();
    useEffect(() => {
        const path = items[0].path
        console.log("ddddddrr", path)
        navigate(path);
    }, [])
    return (
        <>
            <ConfigProvider
                theme={{
                    token: {
                        // colorPrimary: '#e0b96b',
                        // borderRadius: 2,
                        // 派生变量，影响范围小
                        // colorBgContainer: '#a6efef',
                    },
                    components: {
                        Table: {
                            cellPaddingBlockMD: 2,
                            cellFontSizeSM: 12,
                            tableFontSizeSmall: 12,
                        }
                    }
                }}
                // componentSize={'small'}
            >
                <Flex style={{
                    // width: "100%",
                    // overflow:"hidden",
                    padding: 24,
                    // textAlign: 'center',
                    minHeight: 450,
                }}
                >
                    <Outlet/>
                </Flex>
            </ConfigProvider>
        </>
    );
}
